import { SAVE_USER, SAVE_PROFILE } from '../actionTypes/profile'

const initValue = {
  user: {},
  profile: {},
}
export default function reducer(state = initValue, action) {
  if (action.type === SAVE_USER) {
    return {
      ...state,
      user: action.payload,
    }
  }
  if (action.type === SAVE_PROFILE) {
    return {
      ...state,
      profile: action.payload,
    }
  }
  return state
}
